#pragma once

#include <stdint.h>

#include <string>
#include <vector>

namespace libraft {
struct Options {
  std::vector<std::string> members;
  std::string local_ip;
  int local_port;
  std::string db_path;
  std::string log_path;
  std::string meta_path;
  uint64_t check_leader_us;
  uint64_t heart_beat_us;
  uint64_t append_entries_size_once;
  uint64_t append_entries_count_once;
  bool single_mode;
  uint32_t add_current_term;
  bool destory;

  void SetSingleMode(bool mode) { single_mode = mode; }
  void SetDestory(bool des) { destory = des; }
  void SetAddCurrentTerm(uint32_t add);
  void SetMembers(const std::string& cluster_string);
  void Dump();
  std::string ToString();

  Options();
  Options(const std::string& cluster_string, const std::string& local_ip,
          int local_port, const std::string& db_path,
          const std::string& meta_path, const std::string& log_path,
          bool destory = false);
};

}  // namespace libraft
